/* QtLua -- Lua bindings for Qt
   Copyright (C) 2011, Jarek Pelczar

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 3 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General
   Public License along with this library; if not, write to the
   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301 USA

*/

#ifndef QLUASCRIPTENGINEAGENT_H
#define QLUASCRIPTENGINEAGENT_H

#include <QObject>
#include <QVariant>

class QLuaScriptEngineAgentPrivate;
class QLuaScriptEngine;
class QLuaScriptValue;

class QLuaScriptEngineAgent
{
public:
    enum Extension
    {
    };

    QLuaScriptEngineAgent(QLuaScriptEngine * engine);
    virtual ~QLuaScriptEngineAgent();

    virtual void contextPop();
    virtual void contextPush();
    QLuaScriptEngine * engine() const;
    virtual void exceptionCatch(qint64 scriptId, const QLuaScriptValue& exception);
    virtual void exceptionThrow(qint64 scriptId, const QLuaScriptValue& exception, bool hasHandler);
    virtual QVariant extension(Extension extension, const QVariant & argument);
    virtual void functionEntry(qint64 scriptId);
    virtual void functionExit(qint64 scriptId, const QLuaScriptValue & returnValue);
    virtual void positionChange(qint64 scriptId, int lineNumber, int columnNumber);
    virtual void scriptLoad(qint64 id, const QString & program, const QString& fileName, int baseLineNumber);
    virtual void scriptUnload(qint64 id);
    virtual bool supportsExtension(Extension extension ) const;

private:
    friend class QLuaScriptEngineAgentPrivate;
    QLuaScriptEngineAgentPrivate * d;
};

#endif // QLUASCRIPTENGINEAGENT_H
